﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


public class BLL_tbl_supplier_master
{
    public BLL_tbl_supplier_master()
    {

    }

    public List<tbl_supplier_master> select(String USER_CODE)
    {
        DAL_tbl_supplier_master dal = new DAL_tbl_supplier_master();
        return dal.select(USER_CODE);
    }

    public List<tbl_supplier_master> selectAll()
    {
        DAL_tbl_supplier_master dal = new DAL_tbl_supplier_master();
        return dal.selectAll();
    }

    public bool insert(tbl_supplier_master tbl)
    {
        DAL_tbl_supplier_master dal = new DAL_tbl_supplier_master();
        int i = 0;
        i = dal.insert(
            tbl.USER_CODE
, tbl.SUPPLIER_NAME
, tbl.SUPPLIER_ADDRESS
, tbl.SUPPLIER_CITY
, tbl.SUPPLIER_STATE
, tbl.SUPPLIER_PINCODE
, tbl.SUPPLIER_PRIMARY_CONTACT_NO
, tbl.SUPPLIER_SECONDARY_CONTACT_NUMBER
, tbl.SUPPLIER_EMAIL_ID
, tbl.SUPPLIER_SKYPE_ID
, tbl.Payment_Information
, tbl.Bank_Account
, tbl.Supplier_Agreement
, tbl.Supplier_Agreement_Original_Name
, tbl.Fax
, tbl.LinkedIn_ID
, tbl.Tax_Vat_ID
, tbl.IS_ACTIVE
, tbl.CREATED_BY
, tbl.CREATED_DATE
        );

        return Convert.ToBoolean(i);
    }


    public bool update(tbl_supplier_master tbl)
    {
        DAL_tbl_supplier_master dal = new DAL_tbl_supplier_master();
        int i = 0;
        i = dal.update(
            tbl.USER_CODE
, tbl.SUPPLIER_NAME
, tbl.SUPPLIER_ADDRESS
, tbl.SUPPLIER_CITY
, tbl.SUPPLIER_STATE
, tbl.SUPPLIER_PINCODE
, tbl.SUPPLIER_PRIMARY_CONTACT_NO
, tbl.SUPPLIER_SECONDARY_CONTACT_NUMBER
, tbl.SUPPLIER_EMAIL_ID
, tbl.SUPPLIER_SKYPE_ID
, tbl.Payment_Information
, tbl.Bank_Account
, tbl.Supplier_Agreement
, tbl.Supplier_Agreement_Original_Name
, tbl.Fax
, tbl.LinkedIn_ID
, tbl.Tax_Vat_ID
, tbl.IS_ACTIVE
, tbl.UPDATED_BY
, tbl.UPDATED_DATE
            );

        return Convert.ToBoolean(i);
    }


    public bool delete(tbl_supplier_master tbl)
    {
        DAL_tbl_supplier_master dal = new DAL_tbl_supplier_master();
        int i = 0;
        i = dal.delete(
                tbl.USER_CODE
        );

        return Convert.ToBoolean(i);
    }


}

public class BLL_tbl_supplier_master_Certificate
{

    public int update(String USER_CODE, string CERTIFICATION_FILE, string CERTIFICATION_FILE_ORIGINAL_NAME, DateTime CERTIFICATION_DATE, string UPDATED_BY, DateTime UPDATED_DATE, String Supplier_Agreement, String Supplier_Agreement_Original_Name)
    {
        DAL_tbl_supplier_master_Certificate dal = new DAL_tbl_supplier_master_Certificate();
        return dal.update(USER_CODE, CERTIFICATION_FILE, CERTIFICATION_FILE_ORIGINAL_NAME, CERTIFICATION_DATE, UPDATED_BY, UPDATED_DATE, Supplier_Agreement, Supplier_Agreement_Original_Name);
    }

    public List<tbl_supplier_master_Certificate> select(String USER_CODE)
    {
        DAL_tbl_supplier_master_Certificate dal = new DAL_tbl_supplier_master_Certificate();
        return dal.select(USER_CODE);
    }
}